<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>21 T | Glossary</title>
<meta name="author" content="psyTeachR Team">
<meta name="description" content="21.1 tabular data Data in a rectangular table format, where each row has an entry for each column. Tabluar data in R are usually in a data frame or tibble.  year  sex  name  n  rank  nation  1996 ...">
<meta name="generator" content="bookdown 0.24 with bs4_book()">
<meta property="og:title" content="21 T | Glossary">
<meta property="og:type" content="book">
<meta property="og:url" content="https://psyteachr.github.io/glossary/t.html">
<meta property="og:image" content="https://psyteachr.github.io/glossary/images/logos/logo.png">
<meta property="og:description" content="21.1 tabular data Data in a rectangular table format, where each row has an entry for each column. Tabluar data in R are usually in a data frame or tibble.  year  sex  name  n  rank  nation  1996 ...">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="21 T | Glossary">
<meta name="twitter:description" content="21.1 tabular data Data in a rectangular table format, where each row has an entry for each column. Tabluar data in R are usually in a data frame or tibble.  year  sex  name  n  rank  nation  1996 ...">
<meta name="twitter:image" content="https://psyteachr.github.io/glossary/images/logos/logo.png">
<!-- JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/6ecbd6c532.js" crossorigin="anonymous"></script><script src="libs/header-attrs-2.11/header-attrs.js"></script><script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="libs/bootstrap-4.6.0/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-4.6.0/bootstrap.bundle.min.js"></script><script src="libs/bs3compat-0.3.1/transition.js"></script><script src="libs/bs3compat-0.3.1/tabs.js"></script><script src="libs/bs3compat-0.3.1/bs3compat.js"></script><link href="libs/bs4_book-1.0.0/bs4_book.css" rel="stylesheet">
<script src="libs/bs4_book-1.0.0/bs4_book.js"></script><script src="libs/kePrint-0.0.1/kePrint.js"></script><link href="libs/lightable-0.0.1/lightable.css" rel="stylesheet">
<!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=G-6NP3MF25W3"></script><script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-6NP3MF25W3');
    </script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- CSS --><link rel="stylesheet" href="include/psyteachr.css">
<link rel="stylesheet" href="include/webex.css">
<link rel="stylesheet" href="include/style.css">
</head>
<body data-spy="scroll" data-target="#toc">

<div class="container-fluid">
<div class="row">
  <header class="col-sm-12 col-lg-3 sidebar sidebar-book"><a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>

    <div class="d-flex align-items-start justify-content-between">
      <h1>
        <a href="index.html" title="">Glossary</a>
      </h1>
      <button class="btn btn-outline-primary d-lg-none ml-2 mt-1" type="button" data-toggle="collapse" data-target="#main-nav" aria-expanded="true" aria-controls="main-nav"><i class="fas fa-bars"></i><span class="sr-only">Show table of contents</span></button>
    </div>

    <div id="main-nav" class="collapse-lg">
      <form role="search">
        <input id="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>

      <nav aria-label="Table of contents"><h2>Table of contents</h2>
        <ul class="book-toc list-unstyled">
<li><a class="" href="index.html">Overview</a></li>
<li><a class="" href="symbols.html"><span class="header-section-number">1</span> Symbols</a></li>
<li><a class="" href="a.html"><span class="header-section-number">2</span> A</a></li>
<li><a class="" href="b.html"><span class="header-section-number">3</span> B</a></li>
<li><a class="" href="c.html"><span class="header-section-number">4</span> C</a></li>
<li><a class="" href="d.html"><span class="header-section-number">5</span> D</a></li>
<li><a class="" href="e.html"><span class="header-section-number">6</span> E</a></li>
<li><a class="" href="f.html"><span class="header-section-number">7</span> F</a></li>
<li><a class="" href="g.html"><span class="header-section-number">8</span> G</a></li>
<li><a class="" href="h.html"><span class="header-section-number">9</span> H</a></li>
<li><a class="" href="i.html"><span class="header-section-number">10</span> I</a></li>
<li><a class="" href="j.html"><span class="header-section-number">11</span> J</a></li>
<li><a class="" href="k.html"><span class="header-section-number">12</span> K</a></li>
<li><a class="" href="l.html"><span class="header-section-number">13</span> L</a></li>
<li><a class="" href="m.html"><span class="header-section-number">14</span> M</a></li>
<li><a class="" href="n.html"><span class="header-section-number">15</span> N</a></li>
<li><a class="" href="o.html"><span class="header-section-number">16</span> O</a></li>
<li><a class="" href="p.html"><span class="header-section-number">17</span> P</a></li>
<li><a class="" href="q.html"><span class="header-section-number">18</span> Q</a></li>
<li><a class="" href="r.html"><span class="header-section-number">19</span> R</a></li>
<li><a class="" href="s.html"><span class="header-section-number">20</span> S</a></li>
<li><a class="active" href="t.html"><span class="header-section-number">21</span> T</a></li>
<li><a class="" href="u.html"><span class="header-section-number">22</span> U</a></li>
<li><a class="" href="v.html"><span class="header-section-number">23</span> V</a></li>
<li><a class="" href="w.html"><span class="header-section-number">24</span> W</a></li>
<li><a class="" href="x.html"><span class="header-section-number">25</span> X</a></li>
<li><a class="" href="y.html"><span class="header-section-number">26</span> Y</a></li>
<li><a class="" href="z.html"><span class="header-section-number">27</span> Z</a></li>
</ul>

        <div class="book-extra">
          <p><a id="book-repo" href="https://github.com/psyteachr/glossary">View book source <i class="fab fa-github"></i></a></p>
        </div>
      </nav>
</div>
  </header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><div id="t" class="section level1" number="21">
<h1>
<span class="header-section-number">21</span> T<a class="anchor" aria-label="anchor" href="#t"><i class="fas fa-link"></i></a>
</h1>

<div id="tabular-data" class="section level2" number="21.1">
<h2>
<span class="header-section-number">21.1</span> tabular data<a class="anchor" aria-label="anchor" href="#tabular-data"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>Data in a rectangular table format, where each row has an entry for each column.</dfn></p>
<p>Tabluar data in R are usually in a <a href="d.html#data-frame">data frame</a> or <a href="t.html#tibble">tibble</a>.</p>
<div class="kable-table">
<div class="inline-table"><table class="table table-sm">
<thead><tr>
<th style="text-align:right;">
year
</th>
<th style="text-align:left;">
sex
</th>
<th style="text-align:left;">
name
</th>
<th style="text-align:right;">
n
</th>
<th style="text-align:right;">
rank
</th>
<th style="text-align:left;">
nation
</th>
</tr></thead>
<tbody>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Sophie
</td>
<td style="text-align:right;">
7087
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Chloe
</td>
<td style="text-align:right;">
6824
</td>
<td style="text-align:right;">
2
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Jessica
</td>
<td style="text-align:right;">
6711
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Emily
</td>
<td style="text-align:right;">
6415
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Lauren
</td>
<td style="text-align:right;">
6299
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
<tr>
<td style="text-align:right;">
1996
</td>
<td style="text-align:left;">
F
</td>
<td style="text-align:left;">
Hannah
</td>
<td style="text-align:right;">
5916
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:left;">
England &amp; Wales
</td>
</tr>
</tbody>
</table></div>
</div>

</div>
<div id="tag" class="section level2" number="21.2">
<h2>
<span class="header-section-number">21.2</span> tag<a class="anchor" aria-label="anchor" href="#tag"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A way to mark the start and end of HTML elements.</dfn></p>
<p>In <a href="h.html#html">HTML</a>, each <a href="e.html#element-html">element</a> is delineated by tags that describe it. Tags usually start with the element name and optional attribute-value pairs surrounded by angled brackets, and ending with a forward slash and the name surrounded by angled brackets.</p>
<pre><code>&lt;name attribute="value"&gt;Element contents&lt;/name&gt;</code></pre>
<p>For example, a paragraph in HTML is marked by "p" tags like this:</p>
<pre><code>&lt;p&gt;Paragraph text...&lt;/p&gt;</code></pre>
<p>In <a href="s.html#shiny">shiny</a>, tags can be created with the <code>tags()</code> functions.</p>
<div class="sourceCode" id="cb208"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">paragraph</span> <span class="op">&lt;-</span> <span class="va">tags</span><span class="op">$</span><span class="fu">p</span><span class="op">(</span><span class="st">"Paragraph text"</span><span class="op">)</span>

<span class="va">unordered_list</span> <span class="op">&lt;-</span> <span class="va">tags</span><span class="op">$</span><span class="fu">ul</span><span class="op">(</span>
  <span class="va">tags</span><span class="op">$</span><span class="fu">li</span><span class="op">(</span><span class="st">"First list item"</span><span class="op">)</span>,
  <span class="va">tags</span><span class="op">$</span><span class="fu">li</span><span class="op">(</span><span class="st">"Second list item"</span><span class="op">)</span>
<span class="op">)</span></code></pre></div>

</div>
<div id="theme" class="section level2" number="21.3">
<h2>
<span class="header-section-number">21.3</span> theme<a class="anchor" aria-label="anchor" href="#theme"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A consistent style for a report or plots.</dfn></p>
<p>Plots in ggplot can set the theme globally with code like this:</p>
<div class="sourceCode" id="cb209"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># set the default theme to black-and-white</span>
<span class="fu">theme_set</span><span class="op">(</span><span class="fu">theme_bw</span><span class="op">(</span><span class="op">)</span><span class="op">)</span></code></pre></div>
<p>You can set the theme for a html document in the <a href="y.html#yaml">YAML</a> header. View and download different <a href="https://bootswatch.com/4/" target="_blank">themes</a>.</p>
<pre><code>---
title: "My Document"
subtitle: "It's Just a Demo"
author: "Me"
date: "2022-02-10"
output:
  html_document:
    theme: spacelab
    highlight: tango
    toc: true
    toc_float:
      collapsed: false
      smooth_scroll: false
    toc_depth: 3
    number_sections: false
---</code></pre>

</div>
<div id="tibble" class="section level2" number="21.4">
<h2>
<span class="header-section-number">21.4</span> tibble<a class="anchor" aria-label="anchor" href="#tibble"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A <a href="c.html#container">container</a> for <a href="t.html#tabular-data">tabular data</a> with some different properties to a <a href="d.html#data-frame">data frame</a></dfn></p>
<p>Tibbles are almost exactly like the <a href="b.html#base-r">base R</a> <code>data.frame</code> container type, but has some special printing functions, does not coerce <a href="c.html#character">character</a> columns to <a href="f.html#factor">factors</a>, and does not typically use row names.</p>
<div class="sourceCode" id="cb211"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># display the mtcars data frame</span>
<span class="va">mtcars</span></code></pre></div>
<div class="kable-table">
<div class="inline-table"><table class="table table-sm">
<thead><tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
mpg
</th>
<th style="text-align:right;">
cyl
</th>
<th style="text-align:right;">
disp
</th>
<th style="text-align:right;">
hp
</th>
<th style="text-align:right;">
drat
</th>
<th style="text-align:right;">
wt
</th>
<th style="text-align:right;">
qsec
</th>
<th style="text-align:right;">
vs
</th>
<th style="text-align:right;">
am
</th>
<th style="text-align:right;">
gear
</th>
<th style="text-align:right;">
carb
</th>
</tr></thead>
<tbody>
<tr>
<td style="text-align:left;">
Mazda RX4
</td>
<td style="text-align:right;">
21.0
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
160.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.90
</td>
<td style="text-align:right;">
2.620
</td>
<td style="text-align:right;">
16.46
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Mazda RX4 Wag
</td>
<td style="text-align:right;">
21.0
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
160.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.90
</td>
<td style="text-align:right;">
2.875
</td>
<td style="text-align:right;">
17.02
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Datsun 710
</td>
<td style="text-align:right;">
22.8
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
108.0
</td>
<td style="text-align:right;">
93
</td>
<td style="text-align:right;">
3.85
</td>
<td style="text-align:right;">
2.320
</td>
<td style="text-align:right;">
18.61
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Hornet 4 Drive
</td>
<td style="text-align:right;">
21.4
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
258.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.08
</td>
<td style="text-align:right;">
3.215
</td>
<td style="text-align:right;">
19.44
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Hornet Sportabout
</td>
<td style="text-align:right;">
18.7
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
360.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.15
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
17.02
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Valiant
</td>
<td style="text-align:right;">
18.1
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
225.0
</td>
<td style="text-align:right;">
105
</td>
<td style="text-align:right;">
2.76
</td>
<td style="text-align:right;">
3.460
</td>
<td style="text-align:right;">
20.22
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Duster 360
</td>
<td style="text-align:right;">
14.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
360.0
</td>
<td style="text-align:right;">
245
</td>
<td style="text-align:right;">
3.21
</td>
<td style="text-align:right;">
3.570
</td>
<td style="text-align:right;">
15.84
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 240D
</td>
<td style="text-align:right;">
24.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
146.7
</td>
<td style="text-align:right;">
62
</td>
<td style="text-align:right;">
3.69
</td>
<td style="text-align:right;">
3.190
</td>
<td style="text-align:right;">
20.00
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 230
</td>
<td style="text-align:right;">
22.8
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
140.8
</td>
<td style="text-align:right;">
95
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.150
</td>
<td style="text-align:right;">
22.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 280
</td>
<td style="text-align:right;">
19.2
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
167.6
</td>
<td style="text-align:right;">
123
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
18.30
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 280C
</td>
<td style="text-align:right;">
17.8
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
167.6
</td>
<td style="text-align:right;">
123
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
18.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SE
</td>
<td style="text-align:right;">
16.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
4.070
</td>
<td style="text-align:right;">
17.40
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SL
</td>
<td style="text-align:right;">
17.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
3.730
</td>
<td style="text-align:right;">
17.60
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SLC
</td>
<td style="text-align:right;">
15.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
3.780
</td>
<td style="text-align:right;">
18.00
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Cadillac Fleetwood
</td>
<td style="text-align:right;">
10.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
472.0
</td>
<td style="text-align:right;">
205
</td>
<td style="text-align:right;">
2.93
</td>
<td style="text-align:right;">
5.250
</td>
<td style="text-align:right;">
17.98
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Lincoln Continental
</td>
<td style="text-align:right;">
10.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
460.0
</td>
<td style="text-align:right;">
215
</td>
<td style="text-align:right;">
3.00
</td>
<td style="text-align:right;">
5.424
</td>
<td style="text-align:right;">
17.82
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Chrysler Imperial
</td>
<td style="text-align:right;">
14.7
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
440.0
</td>
<td style="text-align:right;">
230
</td>
<td style="text-align:right;">
3.23
</td>
<td style="text-align:right;">
5.345
</td>
<td style="text-align:right;">
17.42
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Fiat 128
</td>
<td style="text-align:right;">
32.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
78.7
</td>
<td style="text-align:right;">
66
</td>
<td style="text-align:right;">
4.08
</td>
<td style="text-align:right;">
2.200
</td>
<td style="text-align:right;">
19.47
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Honda Civic
</td>
<td style="text-align:right;">
30.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
75.7
</td>
<td style="text-align:right;">
52
</td>
<td style="text-align:right;">
4.93
</td>
<td style="text-align:right;">
1.615
</td>
<td style="text-align:right;">
18.52
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Toyota Corolla
</td>
<td style="text-align:right;">
33.9
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
71.1
</td>
<td style="text-align:right;">
65
</td>
<td style="text-align:right;">
4.22
</td>
<td style="text-align:right;">
1.835
</td>
<td style="text-align:right;">
19.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Toyota Corona
</td>
<td style="text-align:right;">
21.5
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
120.1
</td>
<td style="text-align:right;">
97
</td>
<td style="text-align:right;">
3.70
</td>
<td style="text-align:right;">
2.465
</td>
<td style="text-align:right;">
20.01
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Dodge Challenger
</td>
<td style="text-align:right;">
15.5
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
318.0
</td>
<td style="text-align:right;">
150
</td>
<td style="text-align:right;">
2.76
</td>
<td style="text-align:right;">
3.520
</td>
<td style="text-align:right;">
16.87
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
AMC Javelin
</td>
<td style="text-align:right;">
15.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
304.0
</td>
<td style="text-align:right;">
150
</td>
<td style="text-align:right;">
3.15
</td>
<td style="text-align:right;">
3.435
</td>
<td style="text-align:right;">
17.30
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Camaro Z28
</td>
<td style="text-align:right;">
13.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
350.0
</td>
<td style="text-align:right;">
245
</td>
<td style="text-align:right;">
3.73
</td>
<td style="text-align:right;">
3.840
</td>
<td style="text-align:right;">
15.41
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Pontiac Firebird
</td>
<td style="text-align:right;">
19.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
400.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.08
</td>
<td style="text-align:right;">
3.845
</td>
<td style="text-align:right;">
17.05
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Fiat X1-9
</td>
<td style="text-align:right;">
27.3
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
79.0
</td>
<td style="text-align:right;">
66
</td>
<td style="text-align:right;">
4.08
</td>
<td style="text-align:right;">
1.935
</td>
<td style="text-align:right;">
18.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Porsche 914-2
</td>
<td style="text-align:right;">
26.0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
120.3
</td>
<td style="text-align:right;">
91
</td>
<td style="text-align:right;">
4.43
</td>
<td style="text-align:right;">
2.140
</td>
<td style="text-align:right;">
16.70
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Lotus Europa
</td>
<td style="text-align:right;">
30.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
95.1
</td>
<td style="text-align:right;">
113
</td>
<td style="text-align:right;">
3.77
</td>
<td style="text-align:right;">
1.513
</td>
<td style="text-align:right;">
16.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Ford Pantera L
</td>
<td style="text-align:right;">
15.8
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
351.0
</td>
<td style="text-align:right;">
264
</td>
<td style="text-align:right;">
4.22
</td>
<td style="text-align:right;">
3.170
</td>
<td style="text-align:right;">
14.50
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Ferrari Dino
</td>
<td style="text-align:right;">
19.7
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
145.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.62
</td>
<td style="text-align:right;">
2.770
</td>
<td style="text-align:right;">
15.50
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
6
</td>
</tr>
<tr>
<td style="text-align:left;">
Maserati Bora
</td>
<td style="text-align:right;">
15.0
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
301.0
</td>
<td style="text-align:right;">
335
</td>
<td style="text-align:right;">
3.54
</td>
<td style="text-align:right;">
3.570
</td>
<td style="text-align:right;">
14.60
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
8
</td>
</tr>
<tr>
<td style="text-align:left;">
Volvo 142E
</td>
<td style="text-align:right;">
21.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
121.0
</td>
<td style="text-align:right;">
109
</td>
<td style="text-align:right;">
4.11
</td>
<td style="text-align:right;">
2.780
</td>
<td style="text-align:right;">
18.60
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="sourceCode" id="cb212"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># convert the mtcars data frame to a tibble</span>
<span class="fu">tibble</span><span class="fu">::</span><span class="fu"><a href="https://tibble.tidyverse.org/reference/as_tibble.html">as_tibble</a></span><span class="op">(</span><span class="va">mtcars</span>, rownames <span class="op">=</span> <span class="st">"name"</span><span class="op">)</span></code></pre></div>
<div class="kable-table">
<div class="inline-table"><table class="table table-sm">
<thead><tr>
<th style="text-align:left;">
name
</th>
<th style="text-align:right;">
mpg
</th>
<th style="text-align:right;">
cyl
</th>
<th style="text-align:right;">
disp
</th>
<th style="text-align:right;">
hp
</th>
<th style="text-align:right;">
drat
</th>
<th style="text-align:right;">
wt
</th>
<th style="text-align:right;">
qsec
</th>
<th style="text-align:right;">
vs
</th>
<th style="text-align:right;">
am
</th>
<th style="text-align:right;">
gear
</th>
<th style="text-align:right;">
carb
</th>
</tr></thead>
<tbody>
<tr>
<td style="text-align:left;">
Mazda RX4
</td>
<td style="text-align:right;">
21.0
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
160.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.90
</td>
<td style="text-align:right;">
2.620
</td>
<td style="text-align:right;">
16.46
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Mazda RX4 Wag
</td>
<td style="text-align:right;">
21.0
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
160.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.90
</td>
<td style="text-align:right;">
2.875
</td>
<td style="text-align:right;">
17.02
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Datsun 710
</td>
<td style="text-align:right;">
22.8
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
108.0
</td>
<td style="text-align:right;">
93
</td>
<td style="text-align:right;">
3.85
</td>
<td style="text-align:right;">
2.320
</td>
<td style="text-align:right;">
18.61
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Hornet 4 Drive
</td>
<td style="text-align:right;">
21.4
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
258.0
</td>
<td style="text-align:right;">
110
</td>
<td style="text-align:right;">
3.08
</td>
<td style="text-align:right;">
3.215
</td>
<td style="text-align:right;">
19.44
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Hornet Sportabout
</td>
<td style="text-align:right;">
18.7
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
360.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.15
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
17.02
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Valiant
</td>
<td style="text-align:right;">
18.1
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
225.0
</td>
<td style="text-align:right;">
105
</td>
<td style="text-align:right;">
2.76
</td>
<td style="text-align:right;">
3.460
</td>
<td style="text-align:right;">
20.22
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Duster 360
</td>
<td style="text-align:right;">
14.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
360.0
</td>
<td style="text-align:right;">
245
</td>
<td style="text-align:right;">
3.21
</td>
<td style="text-align:right;">
3.570
</td>
<td style="text-align:right;">
15.84
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 240D
</td>
<td style="text-align:right;">
24.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
146.7
</td>
<td style="text-align:right;">
62
</td>
<td style="text-align:right;">
3.69
</td>
<td style="text-align:right;">
3.190
</td>
<td style="text-align:right;">
20.00
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 230
</td>
<td style="text-align:right;">
22.8
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
140.8
</td>
<td style="text-align:right;">
95
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.150
</td>
<td style="text-align:right;">
22.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 280
</td>
<td style="text-align:right;">
19.2
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
167.6
</td>
<td style="text-align:right;">
123
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
18.30
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 280C
</td>
<td style="text-align:right;">
17.8
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
167.6
</td>
<td style="text-align:right;">
123
</td>
<td style="text-align:right;">
3.92
</td>
<td style="text-align:right;">
3.440
</td>
<td style="text-align:right;">
18.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SE
</td>
<td style="text-align:right;">
16.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
4.070
</td>
<td style="text-align:right;">
17.40
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SL
</td>
<td style="text-align:right;">
17.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
3.730
</td>
<td style="text-align:right;">
17.60
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Merc 450SLC
</td>
<td style="text-align:right;">
15.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
275.8
</td>
<td style="text-align:right;">
180
</td>
<td style="text-align:right;">
3.07
</td>
<td style="text-align:right;">
3.780
</td>
<td style="text-align:right;">
18.00
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
3
</td>
</tr>
<tr>
<td style="text-align:left;">
Cadillac Fleetwood
</td>
<td style="text-align:right;">
10.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
472.0
</td>
<td style="text-align:right;">
205
</td>
<td style="text-align:right;">
2.93
</td>
<td style="text-align:right;">
5.250
</td>
<td style="text-align:right;">
17.98
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Lincoln Continental
</td>
<td style="text-align:right;">
10.4
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
460.0
</td>
<td style="text-align:right;">
215
</td>
<td style="text-align:right;">
3.00
</td>
<td style="text-align:right;">
5.424
</td>
<td style="text-align:right;">
17.82
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Chrysler Imperial
</td>
<td style="text-align:right;">
14.7
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
440.0
</td>
<td style="text-align:right;">
230
</td>
<td style="text-align:right;">
3.23
</td>
<td style="text-align:right;">
5.345
</td>
<td style="text-align:right;">
17.42
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Fiat 128
</td>
<td style="text-align:right;">
32.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
78.7
</td>
<td style="text-align:right;">
66
</td>
<td style="text-align:right;">
4.08
</td>
<td style="text-align:right;">
2.200
</td>
<td style="text-align:right;">
19.47
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Honda Civic
</td>
<td style="text-align:right;">
30.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
75.7
</td>
<td style="text-align:right;">
52
</td>
<td style="text-align:right;">
4.93
</td>
<td style="text-align:right;">
1.615
</td>
<td style="text-align:right;">
18.52
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Toyota Corolla
</td>
<td style="text-align:right;">
33.9
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
71.1
</td>
<td style="text-align:right;">
65
</td>
<td style="text-align:right;">
4.22
</td>
<td style="text-align:right;">
1.835
</td>
<td style="text-align:right;">
19.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Toyota Corona
</td>
<td style="text-align:right;">
21.5
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
120.1
</td>
<td style="text-align:right;">
97
</td>
<td style="text-align:right;">
3.70
</td>
<td style="text-align:right;">
2.465
</td>
<td style="text-align:right;">
20.01
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Dodge Challenger
</td>
<td style="text-align:right;">
15.5
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
318.0
</td>
<td style="text-align:right;">
150
</td>
<td style="text-align:right;">
2.76
</td>
<td style="text-align:right;">
3.520
</td>
<td style="text-align:right;">
16.87
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
AMC Javelin
</td>
<td style="text-align:right;">
15.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
304.0
</td>
<td style="text-align:right;">
150
</td>
<td style="text-align:right;">
3.15
</td>
<td style="text-align:right;">
3.435
</td>
<td style="text-align:right;">
17.30
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Camaro Z28
</td>
<td style="text-align:right;">
13.3
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
350.0
</td>
<td style="text-align:right;">
245
</td>
<td style="text-align:right;">
3.73
</td>
<td style="text-align:right;">
3.840
</td>
<td style="text-align:right;">
15.41
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Pontiac Firebird
</td>
<td style="text-align:right;">
19.2
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
400.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.08
</td>
<td style="text-align:right;">
3.845
</td>
<td style="text-align:right;">
17.05
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Fiat X1-9
</td>
<td style="text-align:right;">
27.3
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
79.0
</td>
<td style="text-align:right;">
66
</td>
<td style="text-align:right;">
4.08
</td>
<td style="text-align:right;">
1.935
</td>
<td style="text-align:right;">
18.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
1
</td>
</tr>
<tr>
<td style="text-align:left;">
Porsche 914-2
</td>
<td style="text-align:right;">
26.0
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
120.3
</td>
<td style="text-align:right;">
91
</td>
<td style="text-align:right;">
4.43
</td>
<td style="text-align:right;">
2.140
</td>
<td style="text-align:right;">
16.70
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Lotus Europa
</td>
<td style="text-align:right;">
30.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
95.1
</td>
<td style="text-align:right;">
113
</td>
<td style="text-align:right;">
3.77
</td>
<td style="text-align:right;">
1.513
</td>
<td style="text-align:right;">
16.90
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
2
</td>
</tr>
<tr>
<td style="text-align:left;">
Ford Pantera L
</td>
<td style="text-align:right;">
15.8
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
351.0
</td>
<td style="text-align:right;">
264
</td>
<td style="text-align:right;">
4.22
</td>
<td style="text-align:right;">
3.170
</td>
<td style="text-align:right;">
14.50
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
4
</td>
</tr>
<tr>
<td style="text-align:left;">
Ferrari Dino
</td>
<td style="text-align:right;">
19.7
</td>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
145.0
</td>
<td style="text-align:right;">
175
</td>
<td style="text-align:right;">
3.62
</td>
<td style="text-align:right;">
2.770
</td>
<td style="text-align:right;">
15.50
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
6
</td>
</tr>
<tr>
<td style="text-align:left;">
Maserati Bora
</td>
<td style="text-align:right;">
15.0
</td>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
301.0
</td>
<td style="text-align:right;">
335
</td>
<td style="text-align:right;">
3.54
</td>
<td style="text-align:right;">
3.570
</td>
<td style="text-align:right;">
14.60
</td>
<td style="text-align:right;">
0
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
5
</td>
<td style="text-align:right;">
8
</td>
</tr>
<tr>
<td style="text-align:left;">
Volvo 142E
</td>
<td style="text-align:right;">
21.4
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
121.0
</td>
<td style="text-align:right;">
109
</td>
<td style="text-align:right;">
4.11
</td>
<td style="text-align:right;">
2.780
</td>
<td style="text-align:right;">
18.60
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
2
</td>
</tr>
</tbody>
</table></div>
</div>

</div>
<div id="tidy-data" class="section level2" number="21.5">
<h2>
<span class="header-section-number">21.5</span> tidy data<a class="anchor" aria-label="anchor" href="#tidy-data"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A format for data that maps the meaning onto the structure.</dfn></p>
<p>Tidy data has three rules:</p>
<ul>
<li>Each <a href="v.html#variable">variable</a> must have its own column</li>
<li>Each <a href="o.html#observation">observation</a> must have its own row</li>
<li>Each <a href="v.html#value">value</a> must have its own cell</li>
</ul>
</div>
<div id="tidyverse" class="section level2" number="21.6">
<h2>
<span class="header-section-number">21.6</span> tidyverse<a class="anchor" aria-label="anchor" href="#tidyverse"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A set of R packages that help you create and work with <a href="t.html#tidy-data">tidy data</a></dfn></p>
<p>The <a href="https://www.tidyverse.org/" target="_blank">tidyverse</a> can be loaded with <code><a href="https://tidyverse.tidyverse.org">library(tidyverse)</a></code> and loads the following packages:</p>
<ul>
<li>{ggplot2} for data visualisation</li>
<li>{tibble} for data tables</li>
<li>{tidyr} for <a href="t.html#tidy-data">tidy data</a>
</li>
<li>{readr} for reading in data</li>
<li>{purrr} for <a href="i.html#iteration">iteration</a>
</li>
<li>{dplyr} for <a href="d.html#data-wrangling">data wrangling</a>
</li>
<li>{stringr} for string manipulation</li>
<li>{forcats} for factors</li>
</ul>
<p>Compare with <a href="b.html#base-r">base R</a></p>

</div>
<div id="tied-ranks" class="section level2" number="21.7">
<h2>
<span class="header-section-number">21.7</span> tied ranks<a class="anchor" aria-label="anchor" href="#tied-ranks"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>When two or more values/observations within a variable are identical and assume the same rank order value.</dfn></p>
<p>This is the default for the <code><a href="https://rdrr.io/r/base/rank.html">rank()</a></code> function (<code>ties.method = "average"</code>). You can also set ties to go in the order they are in the dataset (first), in the opposite order (last), a random order (random), all ties have the maximum value (max) or the minimum value (min).</p>
<div class="sourceCode" id="cb213"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">scores</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://tibble.tidyverse.org/reference/tibble.html">tibble</a></span><span class="op">(</span>
  score <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">5</span>, <span class="fl">5</span>, <span class="fl">5</span>, <span class="fl">15</span>, <span class="fl">15</span><span class="op">)</span>
<span class="op">)</span> <span class="op">%&gt;%</span>
  <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span><span class="op">(</span>
    rank <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span><span class="op">)</span>,
    first <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span>, ties.method <span class="op">=</span> <span class="st">"first"</span><span class="op">)</span>,
    last <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span>, ties.method <span class="op">=</span> <span class="st">"last"</span><span class="op">)</span>,
    random <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span>, ties.method <span class="op">=</span> <span class="st">"random"</span><span class="op">)</span>,
    max <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span>, ties.method <span class="op">=</span> <span class="st">"max"</span><span class="op">)</span>,
    min <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rank.html">rank</a></span><span class="op">(</span><span class="va">score</span>, ties.method <span class="op">=</span> <span class="st">"min"</span><span class="op">)</span>
  <span class="op">)</span></code></pre></div>

</div>
<div id="transparency" class="section level2" number="21.8">
<h2>
<span class="header-section-number">21.8</span> transparency<a class="anchor" aria-label="anchor" href="#transparency"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>The degree to which all the steps and decisions in a study have been documented and made available for verification.</dfn></p>

</div>
<div id="treatment-code" class="section level2" number="21.9">
<h2>
<span class="header-section-number">21.9</span> treatment code<a class="anchor" aria-label="anchor" href="#treatment-code"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A <a href="c.html#coding-scheme">coding scheme</a> for categorical variables that creates (n_levels -1) dichotomous variables where each level of the categorical variable is contrasted to a reference level.</dfn></p>
<p>Also referred to as <strong>dummy-coding</strong>.</p>

</div>
<div id="true-negative" class="section level2" number="21.10">
<h2>
<span class="header-section-number">21.10</span> true negative<a class="anchor" aria-label="anchor" href="#true-negative"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>When a test concludes there is no effect when there is really is no effect</dfn></p>

</div>
<div id="true-positive" class="section level2" number="21.11">
<h2>
<span class="header-section-number">21.11</span> true positive<a class="anchor" aria-label="anchor" href="#true-positive"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>When a test concludes there is an effect when there is really is an effect</dfn></p>

</div>
<div id="two-tailed" class="section level2" number="21.12">
<h2>
<span class="header-section-number">21.12</span> two-tailed<a class="anchor" aria-label="anchor" href="#two-tailed"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A statistical test for which the critical region consists of all values of the test statistic greater than a given value plus all values less than another given value.</dfn></p>
<p>See <a href="p.html#p-value">p-value</a> for a comparison of <a href="o.html#one-tailed">one-tailed</a> and two-tailed tests.</p>

</div>
<div id="type-i-error" class="section level2" number="21.13">
<h2>
<span class="header-section-number">21.13</span> Type I Error<a class="anchor" aria-label="anchor" href="#type-i-error"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A <a href="f.html#false-positive">false positive</a>; When a test concludes there is an effect when there is really is no effect</dfn></p>

</div>
<div id="type-ii-error" class="section level2" number="21.14">
<h2>
<span class="header-section-number">21.14</span> Type II Error<a class="anchor" aria-label="anchor" href="#type-ii-error"><i class="fas fa-link"></i></a>
</h2>
<p><dfn>A <a href="f.html#false-negative">false negative</a>; When a test concludes there is no effect when there is really is an effect</dfn></p>

</div>
</div>
<script>

/* update total correct if #webex-total_correct exists */
update_total_correct = function() {
  console.log("webex: update total_correct");

  if (t = document.getElementById("webex-total_correct")) {
    var correct = document.getElementsByClassName("webex-correct").length;
    var solvemes = document.getElementsByClassName("webex-solveme").length;
    var radiogroups = document.getElementsByClassName("webex-radiogroup").length;
    var selects = document.getElementsByClassName("webex-select").length;
    
    t.innerHTML = correct + " of " + (solvemes + radiogroups + selects) + " correct";
  }
}

/* webex-solution button toggling function */
b_func = function() {
  console.log("webex: toggle hide");
  
  var cl = this.parentElement.classList;
  if (cl.contains('open')) {
    cl.remove("open");
  } else {
    cl.add("open");
  }
}

/* function for checking solveme answers */
solveme_func = function(e) {
  console.log("webex: check solveme");

  var real_answers = JSON.parse(this.dataset.answer);
  var my_answer = this.value;
  var cl = this.classList;
  if (cl.contains("ignorecase")) {
    my_answer = my_answer.toLowerCase();
  }
  if (cl.contains("nospaces")) {
    my_answer = my_answer.replace(/ /g, "")
  }

  if (my_answer == "") {
    cl.remove("webex-correct");
    cl.remove("webex-incorrect");
  } else if (real_answers.includes(my_answer)) {
    cl.add("webex-correct");
    cl.remove("webex-incorrect");
  } else {
    cl.add("webex-incorrect");
    cl.remove("webex-correct");
  }

  // match numeric answers within a specified tolerance
  if(this.dataset.tol > 0){
    var tol = JSON.parse(this.dataset.tol);
    var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
    if (matches.reduce((a, b) => a + b, 0) > 0) {
      cl.add("webex-correct");
    } else {
      cl.remove("webex-correct");
    }
  }

  // added regex bit
  if (cl.contains("regex")){
    answer_regex = RegExp(real_answers.join("|"))
    if (answer_regex.test(my_answer)) {
      cl.add("webex-correct");
    }
  }

  update_total_correct();
}

/* function for checking select answers */
select_func = function(e) {
  console.log("webex: check select");
  
  var cl = this.classList
  
  /* add style */
  cl.remove("webex-incorrect");
  cl.remove("webex-correct");
  if (this.value == "answer") {
    cl.add("webex-correct");
  } else if (this.value != "blank") {
    cl.add("webex-incorrect");
  }
  
  update_total_correct();
}

/* function for checking radiogroups answers */
radiogroups_func = function(e) {
  console.log("webex: check radiogroups");

  var checked_button = document.querySelector('input[name=' + this.id + ']:checked');
  var cl = checked_button.parentElement.classList;
  var labels = checked_button.parentElement.parentElement.children;
  
  /* get rid of styles */
  for (i = 0; i < labels.length; i++) {
    labels[i].classList.remove("webex-incorrect");
    labels[i].classList.remove("webex-correct");
  }
  
  /* add style */
  if (checked_button.value == "answer") {
    cl.add("webex-correct");
  } else {
    cl.add("webex-incorrect");
  }
  
  update_total_correct();
}

window.onload = function() {
  console.log("onload");
  /* set up solution buttons */
  var buttons = document.getElementsByTagName("button");

  for (var i = 0; i < buttons.length; i++) {
    if (buttons[i].parentElement.classList.contains('webex-solution')) {
      buttons[i].onclick = b_func;
    }
  }

  /* set up webex-solveme inputs */
  var solveme = document.getElementsByClassName("webex-solveme");

  for (var i = 0; i < solveme.length; i++) {
    /* make sure input boxes don't auto-anything */
    solveme[i].setAttribute("autocomplete","off");
    solveme[i].setAttribute("autocorrect", "off");
    solveme[i].setAttribute("autocapitalize", "off");
    solveme[i].setAttribute("spellcheck", "false");
    solveme[i].value = "";

    /* adjust answer for ignorecase or nospaces */
    var cl = solveme[i].classList;
    var real_answer = solveme[i].dataset.answer;
    if (cl.contains("ignorecase")) {
      real_answer = real_answer.toLowerCase();
    }
    if (cl.contains("nospaces")) {
      real_answer = real_answer.replace(/ /g, "");
    }
    solveme[i].dataset.answer = real_answer;

    /* attach checking function */
    solveme[i].onkeyup = solveme_func;
    solveme[i].onchange = solveme_func;
  }
  
  /* set up radiogroups */
  var radiogroups = document.getElementsByClassName("webex-radiogroup");
  for (var i = 0; i < radiogroups.length; i++) {
    radiogroups[i].onchange = radiogroups_func;
  }
  
  /* set up selects */
  var selects = document.getElementsByClassName("webex-select");
  for (var i = 0; i < selects.length; i++) {
    selects[i].onchange = select_func;
  }

  update_total_correct();
}

</script><script>
$( document ).ready(function() {
  var cite = ' ';
  var psyteachr = ' <a href="https://psyteachr.github.io/"><img src="images/logos/psyteachr_logo.png" style="height: 31px; color: white;" alt="psyTeachR: Reproducible Research" /></a>';
  var license = ' <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/" target="blank"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"></a>';

  $("footer div.row div:eq(1) p").html(
    psyteachr + license + cite
  );
  
  $("#toc").appendTo($("#main-nav"));
});
</script><div class="chapter-nav">
<div class="prev"><a href="s.html"><span class="header-section-number">20</span> S</a></div>
<div class="next"><a href="u.html"><span class="header-section-number">22</span> U</a></div>
</div></main><div class="col-md-3 col-lg-2 d-none d-md-block sidebar sidebar-chapter">
    <nav id="toc" data-toggle="toc" aria-label="On this page"><h2>On this page</h2>
      <ul class="nav navbar-nav">
<li><a class="nav-link" href="#t"><span class="header-section-number">21</span> T</a></li>
<li><a class="nav-link" href="#tabular-data"><span class="header-section-number">21.1</span> tabular data</a></li>
<li><a class="nav-link" href="#tag"><span class="header-section-number">21.2</span> tag</a></li>
<li><a class="nav-link" href="#theme"><span class="header-section-number">21.3</span> theme</a></li>
<li><a class="nav-link" href="#tibble"><span class="header-section-number">21.4</span> tibble</a></li>
<li><a class="nav-link" href="#tidy-data"><span class="header-section-number">21.5</span> tidy data</a></li>
<li><a class="nav-link" href="#tidyverse"><span class="header-section-number">21.6</span> tidyverse</a></li>
<li><a class="nav-link" href="#tied-ranks"><span class="header-section-number">21.7</span> tied ranks</a></li>
<li><a class="nav-link" href="#transparency"><span class="header-section-number">21.8</span> transparency</a></li>
<li><a class="nav-link" href="#treatment-code"><span class="header-section-number">21.9</span> treatment code</a></li>
<li><a class="nav-link" href="#true-negative"><span class="header-section-number">21.10</span> true negative</a></li>
<li><a class="nav-link" href="#true-positive"><span class="header-section-number">21.11</span> true positive</a></li>
<li><a class="nav-link" href="#two-tailed"><span class="header-section-number">21.12</span> two-tailed</a></li>
<li><a class="nav-link" href="#type-i-error"><span class="header-section-number">21.13</span> Type I Error</a></li>
<li><a class="nav-link" href="#type-ii-error"><span class="header-section-number">21.14</span> Type II Error</a></li>
</ul>

      <div class="book-extra">
        <ul class="list-unstyled">
<li><a id="book-source" href="https://github.com/psyteachr/glossary/blob/master/terms/t.Rmd">View source <i class="fab fa-github"></i></a></li>
          <li><a id="book-edit" href="https://github.com/psyteachr/glossary/edit/master/terms/t.Rmd">Edit this page <i class="fab fa-github"></i></a></li>
        </ul>
</div>
    </nav>
</div>

</div>
</div> <!-- .container -->

<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

  <div class="col-12 col-md-6 mt-3">
    <p>"<strong>Glossary</strong>" was written by psyTeachR Team. It was last built on 2022-02-10.</p>
  </div>

  <div class="col-12 col-md-6 mt-3">
    <p>This book was built by the <a class="text-light" href="https://bookdown.org">bookdown</a> R package.</p>
  </div>

</div></div>
</footer><!-- dynamically load mathjax for compatibility with self-contained --><script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script><script type="text/x-mathjax-config">const popovers = document.querySelectorAll('a.footnote-ref[data-toggle="popover"]');
for (let popover of popovers) {
  const div = document.createElement('div');
  div.setAttribute('style', 'position: absolute; top: 0, left:0; width:0, height:0, overflow: hidden; visibility: hidden;');
  div.innerHTML = popover.getAttribute('data-content');

  var has_math = div.querySelector("span.math");
  if (has_math) {
    document.body.appendChild(div);
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, div]);
    MathJax.Hub.Queue(function() {
      popover.setAttribute('data-content', div.innerHTML);
      document.body.removeChild(div);
    })
  }
}
</script>
</body>
</html>
